{% extends "layout.html" %}

{% block content %}
        <div class="container">
            <div>
              <div class="panel panel-default">
                <div class="panel-heading">
                  <h3 class="panel-title">
                    <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                    新增用户
                  </h3>
                </div>
                <div class="panel-body">
                  <form method="POST">
                    {% csrf_token %}
                    <div class="form-group">
                      <label>姓名</label>
                      <input type="text" class="form-control" name="name" placeholder="姓名">
                    </div>
                    <input type="password" class="form-control" name="password" placeholder="密码">
                    <input type="text" class="form-control" name="age" placeholder="年龄">
                    <input type="text" class="form-control" name="account" placeholder="账户">
                    <input type="text" class="form-control" name="create_time" id="dt" placeholder="时间">
                   
                    <div class="form-group">
                      <label>性别</label>
                      <select class="form-control" name="gender">
                        {%for item in gender_choices%}
                        <option value="{{item.0}}">{{item.1}}</option>
                        {%endfor%}
                      </select>
                    </div>

                    <div class="form-group">
                      <label>部门</label>
                      <select class="form-control" name="depart_id">
                        {%for item in depart_list%}
                        <option value="{{item.id}}">{{item.title}}</option>
                        {%endfor%}
                      </select>
                    </div>

                    <button type="submit" class="btn btn-default">提交</button>
                    </form>
                    </div>
              </div>


            </div>


        </div>
{% endblock %}

{% block js %}
          <script>
            $(function(){
                $('#dt').datepicker({
                    formate:'yyyy-mm-dd',
                    startDate:'0',
                    language:"zh-CN",
                    autoclose:true
                })           
            })
            // 工具提示，鼠标放在button上有提示，
            $(function () {
                $('[data-toggle="tooltip"]').tooltip()
                })
            // 弹出框：前面的标签要加一个id=“example", 实现点标签时有旁边有弹出框显示内容
            $('#example').popover('show')
          </script>
{% endblock %}